#ifndef __BattleBorder__AttackerInfo__
#define __BattleBorder__AttackerInfo__

#include "character/CurrencyEntity.h"
#include "gui/TextLabel.h"
#include "gui/MainUIProgressBar.h"
#include <cocos2d.h>

USING_NS_CC;

/**
* Для режима локации Attack и Visit нам надо рендерить блок  с информацией по нам самим.
*/
class AttackerInfo : public CCNode {

public:

	AttackerInfo();

	virtual ~AttackerInfo();

	static AttackerInfo* create();

	bool init();

	void update();

	void updateCurrency(const CurrencyEntity* currency);

private:
	static const float ORIGINAL_SIZE_ICON_GOLD_X;
	static const float ORIGINAL_SIZE_ICON_GOLD_Y;
	static const float ORIGINAL_SIZE_ICON_OIL_X;
	static const float ORIGINAL_SIZE_ICON_OIL_Y;
	static const float ORIGINAL_SIZE_ICON_DIAMOND_X;
	static const float ORIGINAL_SIZE_ICON_DIAMOND_Y;
	static const float ORIGINAL_SIZE_ICON_TROOPS_X;
	static const float ORIGINAL_SIZE_ICON_TROOPS_Y;

	void onStarAchieved(int starCount);
	void showEffectMoney(int starCount);

	TextLabel * moneyOilLabel;
	TextLabel * moneyGoldLabel;
	TextLabel * troopsLabel;

	MainUIProgressBar * progressGold;
	MainUIProgressBar * progressOil;

	TextLabel * maxGoldLabel;
	TextLabel * maxOilLabel;

	std::map<const CurrencyEntity *, TextLabel*> mapCurrencyToTextLabel;
	std::map<const CurrencyEntity *, CCNode*> mapCurrencyToIcon;

	float createCurrencyProgressBars(float yPos);

	void removeEffect(CCNode * effect, void * data);

};

#endif